package com.ruoyi.legal.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 用户信息对象 tb_user
 * 
 * @author xiaoxiao
 * @date 2025-06-26
 */
public class User extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 自增主键 */
    private Long id;

    /** 用户编号业务唯一标识 */
    @Excel(name = "用户编号业务唯一标识")
    private String userNo;

    /** 用户账号 */
    @Excel(name = "用户账号")
    private String userAccount;

    /** 用户昵称 */
    @Excel(name = "用户昵称")
    private String nickname;

    /** 真实姓名 */
    @Excel(name = "真实姓名")
    private String realName;

    /** 密码哈希 */
    private String passwordHash;

    /** 是否启用（0启用1禁用） */
    @Excel(name = "是否启用", readConverterExp = "0=启用1禁用")
    private Long isEnabled;

    /** 是否管理员（1是 0否） */
    @Excel(name = "是否管理员", readConverterExp = "1=是,0=否")
    private Long isAdmin;

    /** 帐号状态（0正常 1停用） */
    @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
    private Long accountStatus;

    /** 手机号 */
    @Excel(name = "手机号")
    private String phoneNumber;

    /** 邮箱 */
    @Excel(name = "邮箱")
    private String email;

    /** 性别（0男 1女 2未知） */
    @Excel(name = "性别", readConverterExp = "0=男,1=女,2=未知")
    private String sex;

    /** 头像地址 */
    private String avatarUrl;

    /** 最后登录IP */
    @Excel(name = "最后登录IP")
    private String lastIp;

    /** 最后登录时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastLoginTime;

    /** 创建人 */
    private String creator;

    /** 更新人 */
    @Excel(name = "更新人")
    private String updater;

    /** 用户积分 */
    private Long points;

    /** 权限版本号（初始为0） */
    private Long roleVersion;

    /** 封禁版本号（初始为0） */
    private Long banVersion;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setUserNo(String userNo) 
    {
        this.userNo = userNo;
    }

    public String getUserNo() 
    {
        return userNo;
    }

    public void setUserAccount(String userAccount) 
    {
        this.userAccount = userAccount;
    }

    public String getUserAccount() 
    {
        return userAccount;
    }

    public void setNickname(String nickname) 
    {
        this.nickname = nickname;
    }

    public String getNickname() 
    {
        return nickname;
    }

    public void setRealName(String realName) 
    {
        this.realName = realName;
    }

    public String getRealName() 
    {
        return realName;
    }

    public void setPasswordHash(String passwordHash) 
    {
        this.passwordHash = passwordHash;
    }

    public String getPasswordHash() 
    {
        return passwordHash;
    }

    public void setIsEnabled(Long isEnabled) 
    {
        this.isEnabled = isEnabled;
    }

    public Long getIsEnabled() 
    {
        return isEnabled;
    }

    public void setIsAdmin(Long isAdmin) 
    {
        this.isAdmin = isAdmin;
    }

    public Long getIsAdmin() 
    {
        return isAdmin;
    }

    public void setAccountStatus(Long accountStatus) 
    {
        this.accountStatus = accountStatus;
    }

    public Long getAccountStatus() 
    {
        return accountStatus;
    }

    public void setPhoneNumber(String phoneNumber) 
    {
        this.phoneNumber = phoneNumber;
    }

    public String getPhoneNumber() 
    {
        return phoneNumber;
    }

    public void setEmail(String email) 
    {
        this.email = email;
    }

    public String getEmail() 
    {
        return email;
    }

    public void setSex(String sex) 
    {
        this.sex = sex;
    }

    public String getSex() 
    {
        return sex;
    }

    public void setAvatarUrl(String avatarUrl) 
    {
        this.avatarUrl = avatarUrl;
    }

    public String getAvatarUrl() 
    {
        return avatarUrl;
    }

    public void setLastIp(String lastIp) 
    {
        this.lastIp = lastIp;
    }

    public String getLastIp() 
    {
        return lastIp;
    }

    public void setLastLoginTime(Date lastLoginTime) 
    {
        this.lastLoginTime = lastLoginTime;
    }

    public Date getLastLoginTime() 
    {
        return lastLoginTime;
    }

    public void setCreator(String creator) 
    {
        this.creator = creator;
    }

    public String getCreator() 
    {
        return creator;
    }

    public void setUpdater(String updater) 
    {
        this.updater = updater;
    }

    public String getUpdater() 
    {
        return updater;
    }

    public void setPoints(Long points) 
    {
        this.points = points;
    }

    public Long getPoints() 
    {
        return points;
    }

    public void setRoleVersion(Long roleVersion) 
    {
        this.roleVersion = roleVersion;
    }

    public Long getRoleVersion() 
    {
        return roleVersion;
    }

    public void setBanVersion(Long banVersion) 
    {
        this.banVersion = banVersion;
    }

    public Long getBanVersion() 
    {
        return banVersion;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userNo", getUserNo())
            .append("userAccount", getUserAccount())
            .append("nickname", getNickname())
            .append("realName", getRealName())
            .append("passwordHash", getPasswordHash())
            .append("isEnabled", getIsEnabled())
            .append("isAdmin", getIsAdmin())
            .append("accountStatus", getAccountStatus())
            .append("phoneNumber", getPhoneNumber())
            .append("email", getEmail())
            .append("sex", getSex())
            .append("avatarUrl", getAvatarUrl())
            .append("lastIp", getLastIp())
            .append("lastLoginTime", getLastLoginTime())
            .append("creator", getCreator())
            .append("createTime", getCreateTime())
            .append("updater", getUpdater())
            .append("updateTime", getUpdateTime())
            .append("points", getPoints())
            .append("roleVersion", getRoleVersion())
            .append("banVersion", getBanVersion())
            .toString();
    }
}
